﻿using System;
using System.Globalization;

namespace Base.Common.Converters
{
    public class IsEquelConverter:ConverterBase
    {
        /// <summary>
        /// 待比较的值
        /// </summary>
        public object Compair { get; set; }

        /// <summary>
        /// 是否反转
        /// </summary>
        public bool Invert { get; set; }

        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var result = value == Compair;
            return Invert ? !result : result;
        }

        public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
